-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.x - OpenAPI updates #7669
4.x - OpenAPI updates #7669
Conversation
- Minimalistic SE OpenAPI support with SPI to implement the MicroProfile support and OpenAPI UI - Make openapi a multi-module with two sub-modules: openapi and openapi-ui - Add openapi/tests and move helidon-iogh-5792 from tests/integration - Re-enabled test, make it strictly a test (not an app) and use version.lib.snakeyaml to override the SnakeYAML version - Created OpenApiFormat to formalize what was before OpenApiFeature.OpenAPIMediaType - Microprofile OpenAPI refactorings: - MPOpenAPIBuilder into FilteredIndexViewsBuilder as a utility to create List<FilteredIndexView> - MpOpenApiManager implements OpenApiManager using SmallRye OpenAPI (what was before in MpOpenApiFeature - Prefix utility classes with OpenApi: - ParserHelper -> OpenApiParser - Serializer -> OpenApiSerializer - Renamed HelidonAnnotationScannerExtension to JsonpAnnotationScannerExtension to remove 'Helidon' from the class name - Renamed tests to use Test as a suffix instead of prefix - Updated examples/openapi to remove the in-memory model related features (i.e. reader, filter) - Renamed examples/microprofile/openapi-basic to examples/microprofile/openapi (to be symetrical with SE) - Updated tests to use new testing patterns (i.e. helidon-microprofile-testing-junit5 for MP and helidon-webserver-testing-junit5 for SE) - Generated config docs for openapi/openapi, openapi/openapi-ui, microprofile/openapi (Removed old files) Fixes helidon-io#7247 (SE OpenAPI static file support) Fixes helidon-io#7240 (Fix helidon-iogh-5792 integration test) Fixes helidon-io#6130 (Port OpenAPI UI integration to 4.x) Fixes helidon-io#7643 (OpenAPI parsing fails to handle default in some cases) Fixes helidon-io#7668 (Routing path with optional sequence not supported)
27fe27e
to
f7b0e33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of stylistic changes as well as functional ones, but I think I made my way through them all!
One specific change: Please update the openapi.yml
file in the example as follows:
diff --git a/examples/openapi/src/main/resources/META-INF/openapi.yml b/examples/openapi/src/main/resources/META-INF/openapi.yml
index 8a7c77a20..617333bc3 100644
--- a/examples/openapi/src/main/resources/META-INF/openapi.yml
+++ b/examples/openapi/src/main/resources/META-INF/openapi.yml
@@ -49,12 +49,10 @@ paths:
examples:
greeting:
summary: Example greeting message to update
- value: New greeting message
+ value: { "greeting": "Hola" }
responses:
- "200":
- description: OK
- content:
- application/json: {}
+ "204":
+ description: Updated
/greet/{name}:
get:
summary: Returns a personalized greeting
This way the static OpenAPI document conforms better to the behavior of the PUT
which changes the greeting (the status is 204, not 200) and the example should be JSON not plain text so the UI works correctly without the user having to edit anything. These are not changes which this PR introduced, but we might as well fix them now.
My one lingering concern, which we discussed earlier and I know you considered, is that our wrapper around the UI is in my mind very much an integration which is why I added it under integrations
originally. To bring it under helidon/openapi
as a submodule, to me, suggests a level of commitment to and therefore support by Helidon of the SmallRye and Swagger code that make up the UI which I would rather we did not convey.
- Use FQN the provide statement in openapi/openapi-ui/src/main/java/module-info.java - Update META-INF/openapi.yml
It's true that I made stylistic changes. Because I made so many changes (renames, compiler warnings etc.) I decided to keep the stylistic changes. However, if you feel strongly about this, let me know what to revert and I will comply (Sir, Yes Sir!)
I have made the change.
Let's raise this concern with the team and get a consensus on what to do (either rollback the GAV change or keep it this way). |
openapi
a multi-module with two sub-modules:openapi
andopenapi-ui
gh-5792
from tests/integrationversion.lib.snakeyaml
to override the SnakeYAML versionOpenApiFormat
to formalize what was beforeOpenApiFeature.OpenAPIMediaType
MPOpenAPIBuilder
->FilteredIndexViewsBuilder
as a utility to createList<FilteredIndexView>
MpOpenApiManager
implementsOpenApiManager
using SmallRye OpenAPI (what was before inMpOpenApiFeature
OpenApi
:ParserHelper
->OpenApiParser
Serializer
->OpenApiSerializer
HelidonAnnotationScannerExtension
toJsonpAnnotationScannerExtension
to remove 'Helidon' from the class nameTest
as a suffix instead of prefixexamples/openapi
to remove the in-memory model related features (i.e. reader, filter)examples/microprofile/openapi-basic
toexamples/microprofile/openapi
(to be symetrical with SE)helidon-microprofile-testing-junit5
for MP andhelidon-webserver-testing-junit5
for SE)openapi/openapi
,openapi/openapi-ui
,microprofile/openapi
(Removed old files)Fixes #7247 (SE OpenAPI static file support)
Fixes #7240 (Fix
gh-5792
integration test)Fixes #6130 (Port OpenAPI UI integration to 4.x)
Fixes #7643 (OpenAPI parsing fails to handle default in some cases)
Fixes #7668 (Routing path with optional sequence not supported)
Documentation impact
OpenAPI UI Maven coordinates changes:
Old:
New:
The change is included in this pull request.
In-Memory model related features are no longer supported in SE
This means the effective configuration available in SE is restricted to what is listed in
docs/config/io_helidon_openapi_OpenApiFeature.adoc
: